package ehcache.cluster;

import org.ehcache.PersistentCacheManager;
import org.ehcache.clustered.client.config.builders.ClusteringServiceConfigurationBuilder;
import org.ehcache.config.builders.CacheManagerBuilder;

import java.net.URI;

/**
 * Created by dongjigong on 2018/4/28.
 *
 * @Email osbornjonny@126.com
 * @Description
 */
public class ClusterDemo {
    public static void main(String[] args) {
        CacheManagerBuilder<PersistentCacheManager> cacheManagerCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder()
                .with(ClusteringServiceConfigurationBuilder.cluster(URI.create("")).autoCreate());
        PersistentCacheManager cacheManager = cacheManagerCacheManagerBuilder.build(true);
        cacheManager.close();
    }
}
